import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { JdDirectTransferOrder1VO, JdDirectTransferOrder1Form, JdDirectTransferOrder1Query } from '@/api/jdAndJstSceneClassification/allot/jdDirectTransferOrder1/types';

/**
 * 查询金蝶-直接调拨单列表
 * @param query
 * @returns {*}
 */
export const listJdDirectTransferOrder1 = (query?: JdDirectTransferOrder1Query): AxiosPromise<JdDirectTransferOrder1VO[]> => {
  return request({
    url: '/c/jd/directTransferOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-直接调拨单列表
 * 01、定义后端接口
 * @param query
 * @returns {*}
 */
export const listJdDirectTransferOrder1ByAllotWarehouse1 = (query?: JdDirectTransferOrder1Query): AxiosPromise<JdDirectTransferOrder1VO[]> => {
  return request({
    url: '/dataCheck/jd/directTransferOrder/list-by-allot-warehouse1',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-直接调拨单详细
 * @param id
 */
export const getJdDirectTransferOrder1 = (id: string | number): AxiosPromise<JdDirectTransferOrder1VO> => {
  return request({
    url: '/dataCheck/jd/directTransferOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增金蝶-直接调拨单
 * @param data
 */
export const addJdDirectTransferOrder1 = (data: JdDirectTransferOrder1Form) => {
  return request({
    url: '/dataCheck/jd/directTransferOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改金蝶-直接调拨单
 * @param data
 */
export const updateJdDirectTransferOrder1 = (data: JdDirectTransferOrder1Form) => {
  return request({
    url: '/dataCheck/jd/directTransferOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除金蝶-直接调拨单
 * @param id
 */
export const delJdDirectTransferOrder1 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jd/directTransferOrder/' + id,
    method: 'delete'
  });
};
